<script lang="ts" setup>

import type {CustomGridList} from "@/interfaces/custom-grid";

interface Props {
  list: CustomGridList[]
}

const {list} = defineProps<Props>()
const goBookList = (listIndex:number) => {
  uni.$u.route({
    url:'/pages/book/book',
    params:{
      index:listIndex
    }
  })
}
</script>

<template>
  <view>
    <u-grid
        :border="false"
        col="4"
    >
      <u-grid-item
          v-for="(listItem,listIndex) in list"
          :key="listIndex"
          @tap="goBookList(listIndex)"
      >
        <text class="grid-text">{{ listItem.label }}</text>
        <text class="grid-text">{{ listItem.count }}</text>
      </u-grid-item>
    </u-grid>
  </view>
</template>

<style lang="scss" scoped>

</style>